package com.yzy.fly;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;

@Slf4j
public class FlyAppApplication {

    public static void run(Class<?> primarySource, String... args) throws Exception {
        run(new String[]{}, primarySource, args);
    }

    public static void run(String[] scannerPaths, Class<?> primarySource, String... args) throws Exception {
        StartAppClassNameListener myApplicationListener = new StartAppClassNameListener();
        myApplicationListener.setScannerPaths(scannerPaths);
        SpringApplication springApplication = new SpringApplicationBuilder(primarySource)
                .listeners(myApplicationListener).build();
        springApplication.run(args);

    }

}
